home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / admin / tidy-1.000 / tidy-1 / tidy-1.0 / tidy.conf < prev    next >
Encoding:
Text File  |  1996-03-14  |  12.8 KB  |  298 lines

  1. ############################################################################
  2. # Tidy 1.0 Configuration File
  3. #
  4. # COPYRIGHT (C) 1996 Marek Rouchal
  5.  
  6. ############################################################################
  7. # IMPORTANT!
  8. # You may change the values in this file in order to customize the
  9. # behavior of tidy. Do NOT remove the if/unless functions, otherwise
  10. # command line settings won't work. This is because command line options
  11. # are evaluated before looking at this file. This isn't pretty, but
  12. # it simplifies things for me :)
  13. # And: Please stick to the valid settings. Everything else will
  14. #      produce ugly unpredictable results.
  15.  
  16. ############################################################################
  17. # Paths & Files
  18.  
  19. # This is where syslog puts its messages.
  20. # on linux systems it is often /var/adm/MAIL
  21. $LOGFILE = "/var/adm/MAIL" unless $LOGFILE;
  22.  
  23. # This specifies the database File where statistics are stored
  24. # you might say /var/adm/tidy.db here if you intend to run tidy as
  25. # the super-user
  26. $DBFILE = "/var/adm/tidy.db" unless $DBFILE;
  27.  
  28. # This is the path to the statistics output files
  29. # This is automatically overridden when the -o command line option
  30. # is used.
  31. $OUTDIR = $ENV{'PWD'} || ".";
  32.  
  33. # These are the default statistics output filenames
  34. # if no -o option is given
  35. $OUTFILE_ASCII = "tidy.txt";
  36. $OUTFILE_HTML  = "tidy.html";
  37.  
  38. ###########################################################################
  39. # Statistics output format settings
  40. # ... determine the design of the statistics output file
  41.  
  42. # This specifies the default output format
  43. # valid settings are "none", "ascii" and "html"
  44. # "none" means that no output is produced. However, tidy still
  45. #        tidies the log file and saves statistics to the database
  46. # "ascii" produces basic text-only output.
  47. # "html"  produces neat tables. You need a browser that handles <TABLE>
  48. #         to view them. Netscape higher than 1.1 is OK.
  49. $OUTPUT = "ascii" unless $OUTPUT;
  50.  
  51. # This is the time (of last contact) configuration.
  52. # valid settings are "none", "short", "long"
  53. # "short" is e.g. '19:21'
  54. # "long"  is e.g. '19:21:13'
  55. $FORM_TIME = "short" unless $FORM_TIME;
  56.  
  57. # This is the date (of last contact) configuration
  58. # valid settings are "none", "short", "long"
  59. # "short" is e.g. '04/24'
  60. # "long"  is e.g. 'Apr 24'
  61. $FORM_DATE = "long" unless $FORM_DATE;
  62.  
  63. # This defines whether the time/date stamps should be printed
  64. # besides or below the number of remote host contacts
  65. # If you are short of width (80 columns), you'd prefer "below"
  66. # valid settings are "besides" and "below"
  67. $ORIENTATION = "below" unless $ORIENTATION;
  68.  
  69. # This has different meanings in the ASCII and HTML context:
  70. # ASCII: This specifies whether a ruler line consisting of
  71. # "-----+-----" should be inserted after each entry when printing the
  72. # statistics. You may want it when you are printing time and date to
  73. # enhance readability.
  74. # HTML: If $RULER is set to "on", tidy will produce one
  75. # huge table. I noticed that e.g. Netscape for Windows had
  76. # problems in displaying a 180k table. $RULER set to "off"
  77. # will produce small tables of $PAGER_LINES length.
  78. # valid settings are "on" and "off"
  79. $RULER = "on" unless $RULER;
  80.  
  81. # This gives the number of lines after that the header
  82. # is printed again to the outfile so that the
  83. # columns can be easier distinguished.
  84. # Zero value means printing of the header only at the
  85. # very beginning of the statistics file.
  86. $PAGER_LINES = 15 if (!defined($PAGER_LINES) );
  87.  
  88. # This is the sortkey for the statistics output.
  89. # valid settings are "none", "host", "domain" and the
  90. # keywords listed below in the CATEGORY section.
  91. # "none" means no sorting, entries will appear in an arbitrary order
  92. # "host" means sort by host name
  93. # "domain" means sort by domains, i.e. foo.bar.de is sorted as de.bar.foo
  94. # If you specify a keyword listed below, then hosts are sorted by the
  95. # number of contacts (highest numbers first)
  96. $SORTKEY = "host" unless $SORTKEY;
  97.  
  98. # Shall the hosts/domains be sorted regardless of upper/lower case letters?
  99. # "off" means case insensitive, "on" means case sensitive
  100. $CASE_SENSITIVE = "off" unless $CASE_SENSITIVE;
  101.  
  102. ############################################################################
  103. # Logfile Categories/Services
  104.  
  105. # These are the categories which (may) appear in the log file created
  106. # by syslogd. You will probably want to change this. Just read the
  107. # following paragraph, look at the defaults and change them. If you
  108. # have problems with Regexp's (regular expressions), refer to the
  109. # perlre man page.
  110. #
  111. # Categories are indexed with a keyword, which may be referred to by $SORTKEY.
  112. #
  113. # Each category consists of 6 entries:
  114. #  1. Priority. Categories with higher priority (i.e. LOWER
  115. #     number) are searched for first. This can result in better
  116. #     log file processing performance if this category appears
  117. #     often in the log file. This number also specifies in which
  118. #     column the category appears in the output.
  119. #  2. Regexp for ident string. The ident string is typically the name
  120. #     of the program that called syslog (e.g. sendmail, in.telnetd).
  121. #     Syslog often adds the PID. This is being recognized automatically
  122. #     by tidy, so you don't have to give it here. See also syslog(3).
  123. #  3. Regexp to extract remote host name from message. These look
  124. #     rather ugly (esp. for sendmail), but they do their job, i.e. to
  125. #     search the entire message string (e.g. 'connect from foo.bar.dom')
  126. #     for the remote host name contained in the message (e.g. 'foo.bar.dom').
  127. #     The remote host name must be written to $1
  128. #     It requires some knowledge of RE's to construct this entry, but
  129. #     this way almost every possibility can be covered. Refer to
  130. #     the perlre man page if you don't understand what happens below.
  131. #  4. Regexp. Entry will be discarded if it matches. Tidy will first try
  132. #     to extract a remote host with the RE above. If this fails, it may
  133. #     still be possible that the message contains no important
  134. #     information (e.g. sendmail to local users, unsuspicious errors)
  135. #     that you want to be discarded from the log file.
  136. #  5. Table heading string for ASCII output
  137. #     This should be readable when only the first four chars of it
  138. #     are printed. A column is only 4 chars wide when there is no
  139. #     time/date output!
  140. #  6. Caption string for HTML output
  141. #     You may add additional format information for the <TH> directive,
  142. #     i.e. supply the string, which will fit here: "<TH $your_string</TH>"
  143. #     Be sure to give at least "> Telnet", for example. This is because
  144. #     eventually "<TH COLSPAN=2" is used.
  145.  
  146. # For those completely unfamiliar to RE's, I'll explain what happens here.
  147. # Consider 'connect from \s+(\S+).*$'
  148. # The message string is searched for the string 'connect from', followed
  149. # by an arbitrary amount of whitespace ( '\s+' the '+' means that at least
  150. # one char of whitespace must be present, '\s' stands for space or tab)
  151. # '(\S+)' matches as much non-whitespace as possible. The '()' will
  152. # generate a back reference, i.e. the string matched by '\S+' will be
  153. # saved to $1 which is then used by tidy.
  154. # '.*$' matches anything that comes after the non-whitespace. This is
  155. # done by the '.*' part, where '.' matches any character and '*' means
  156. # any number of occurrences, including 0.
  157.  
  158. $CATEGORY{'TELNET'}   = [ 1, 'in.telnetd',
  159.                          'connect from\s+(\S+).*$',
  160.                          '', 'TELNT', '><I>Telnet</I>' ];
  161. $CATEGORY{'RLOGIN'}   = [ 2, 'in.rlogind',
  162.                          'connect from\s+(\S+).*$',
  163.                          '', 'RLOGN', '><I>Rlogin</I>' ];
  164. $CATEGORY{'FTP'}      = [ 3, 'wu.ftpd', 
  165.                          'connect from\s+(\S+).*$',
  166.                          '', 'FTP', '><I>FTP</I>' ];
  167.  
  168. # In order to better understand what the following is about, look at this
  169. # line from the syslogd-logfile. Remember that you want to get
  170. # 'freenet.uni-bayreuth.de; in this case, but only if the message really has
  171. # been sent! (The rest of the comment was originally one line!)
  172. # '(?:  )' means simply that the result of '()' isn't saved as a back
  173. # reference.
  174. # Original line from log file:
  175. # Feb 21 17:42:53 saftsack sendmail[1300]: RAA01299: 
  176. # to=a0123@freenet.uni-bayreuth.de, ctladdr=marek (408/100), delay=00:00:29, 
  177. # mailer=smtp, relay=freenet.uni-bayreuth.de. [132.180.15.7], 
  178. # stat=Sent (RAA23561 Message accepted for delivery)
  179.  
  180. $CATEGORY{'MAILTO'}     = [ 4, 'sendmail',
  181.                  '^.* to=.*?\@(\S+?)(?:>,|,).*stat=Sent.*$',
  182.                            ' to=', # the space is vitally important!
  183.  
  184. # This is because sendmail lines may contain a 'proto=', which
  185. # of course is matched by /to=/. This would cancel the 'MAILFROM' entries.
  186.  
  187.                            'M_TO', '><I>Mail To</I>' ];
  188. $CATEGORY{'MAILFROM'}     = [ 5, 'sendmail',
  189.                          '^.* from=.*?\@(\S+?)(?:>,|,).*$',
  190.                          ' from=', 'M_FR', '><I>Mail From</I>' ];
  191.  
  192. # The 'TALK' category matches entries from both
  193. # talkd and ntalkd
  194.  
  195. $CATEGORY{'TALK'}     = [ 6, '(in.talkd|in.ntalkd)',
  196.                          'connect from\s+(\S+).*$',
  197.                          '', 'TALK', '><I>Talk</I>' ];
  198. $CATEGORY{'FINGER'}   = [ 7, '(in.fingerd|in.kfingerd)',
  199.                          'connect from\s+(\S+).*$',
  200.                          '', 'FINGR', '><I>Finger</I>' ];
  201. # Maybe you won't ever need this one
  202. $CATEGORY{'RSH'}      = [ 8, 'in.rshd',
  203.                          'connect from\s+(\S+).*$',
  204.                          '', 'RSHLL', '><I>Remote Shell</I>' ];
  205.  
  206. # This is the table header for the "Remote Host" column, HTML only
  207. $REMOTE_HEADER = "<TH ALIGN=LEFT><I>Remote Host</I></TH>";
  208.  
  209. ###########################################################################
  210. # Host name aliasing
  211.  
  212. # This hash serves to cast host names to other names. This is useful if
  213. # aliases of one host exist and you do not want them to become separate 
  214. # entries in your statistics.
  215. # You can also use this to cast IP addresses to more meaningful names or
  216. # lots of similar terminals to one general entry.
  217. # Sample:
  218. # %HOSTNAME_ALIAS = ( 'saftsack.fs.uni-bayreuth.de' => 'localhost',
  219. #                     'btfmd2.fs.uni-bayreuth.de'   => 'localhost' );
  220. #
  221. %HOSTNAME_ALIAS = ( );
  222.  
  223. ###########################################################################
  224. # This are the headers and trailers for output
  225. # You may use the names $CREATION_DATE and $LAST_UPDATE
  226. # Their meaning should be clear :)
  227. # $LOG_REMOTE is the number of processed logfile lines that contained
  228. # remote hosts, $LOG_DISCARD is the number of lines discarded by the
  229. # 2nd RE. $TOTAL_REMOTE is the number of remote hosts in the current
  230. # database.
  231. # Be sure to escape the '$', i.e. \$, as these strings are eval'ed
  232.  
  233. @ASCII_HEADER = (
  234.     "Remote hosts contacts statistics",
  235.     "================================",
  236.     "",
  237.     "for <localhost>",             # you WANT to edit this!
  238.     "",
  239.     "Database created \$CREATION_DATE",
  240.     "Last updated     \$LAST_UPDATE",
  241.     "",
  242.     "Processed lines: with remote host contacts: \$LOG_REMOTE",
  243.     "                 discarded lines:           \$LOG_DISCARD",
  244.     "",
  245.     "Total number of remote hosts: \$TOTAL_REMOTE",
  246.     "",
  247.     "These statistics were created by tidy 1.0",
  248.     "" );
  249.  
  250. @ASCII_TRAILER = (
  251.     "",
  252.     "These statistics were created by tidy 1.0",
  253.     "written by M. Rouchal, University of Bayreuth, Germany",
  254.     "tidy is freely available from its official ftp site:",
  255.     "ftp://saftsack.fs.uni-bayreuth.de/pub/tidy/" );
  256.  
  257. @HTML_HEADER = (
  258.     "<HTML><HEAD><TITLE>Remote Hosts Contact Statistics</TITLE></HEAD>",
  259.     "<BODY><H1>Remote Hosts Contact Statistics</H1>",
  260.     "<HR>",
  261.     "<I>Local Host:</I> localhost<P>",       # you WANT to edit this!
  262.     "<I>Database created</I> \$CREATION_DATE<BR>",
  263.     "<I>Last updated</I> \$LAST_UPDATE<P>",
  264.     "<I>Processed lines:</I><BR>",
  265.     "<I>... with remote host contacts:</I> \$LOG_REMOTE<BR>",
  266.     "<I>... discarded lines:</I> \$LOG_DISCARD<P>",
  267.     "<I>Total number of remote hosts:</I> \$TOTAL_REMOTE<P>",
  268.     "These statistics were created by <A HREF=\\\"#tidy\\\">tidy 1.0</A>.",
  269.     "<HR>" );
  270.  
  271. @HTML_TRAILER = (
  272.     "<HR>",
  273.     "<A NAME=\\\"tidy\\\"></A>These statistics were created by tidy 1.0<BR>",
  274.     "written by <I>M. Rouchal</I>, University of Bayreuth, Germany<P>",
  275.     "Comments and bug reports are welcome. Please refer to<BR>",
  276.     "<I><A HREF=\\\"mailto:marek\\\@saftsack.fs.uni-bayreuth.de\\\">",
  277.     "marek\\\@saftsack.fs.uni-bayreuth.de</A></I><P>",
  278.     "<I>tidy</I> is freely available from its",
  279.     "<A HREF=\\\"http://saftsack.fs.uni-bayreuth.de/~marek/tidy/index.html\\\">WWW Home Page</A><P>",
  280.     "</BODY></HTML>" );
  281.  
  282. ###########################################################################
  283. # This is needed for the translation of dates
  284.  
  285. %MONTH_STR_TO_NUM = ( 'Jan' => '01', 'Feb' => '02', 'Mar' => '03',
  286.         'Apr' => '04', 'May' => '05', 'Jun' => '06',
  287.         'Jul' => '07', 'Aug' => '08', 'Sep' => '09',
  288.         'Oct' => '10', 'Nov' => '11', 'Dec' => '12' );
  289.  
  290. @MONTH_NUM_TO_STR = ( '???', 'Jan', 'Feb', 'Mar',
  291.         'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
  292.         'Oct', 'Nov', 'Dec' );
  293.  
  294. ###########################################################################
  295. # END OF CONFIGURATION FILE - do not alter anything below this line
  296. 1;
  297.  
  298.